{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "作业要求以学号命名，类似\"123456.ipynb\"，不需要加姓名。\n",
    "\n",
    "\n",
    "作业提交的方式见下面链接：\n",
    "https://blog.csdn.net/sheagu/article/details/122397816"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 题目一\n",
    "\n",
    "有一个这样的DNA核酸序列\n",
    "\n",
    "“AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC”\n",
    "\n",
    "请把这个核酸序列存入一个list，并数一数A、G、C、T各有多少个。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['A', 'G', 'C', 'T', 'T', 'T', 'T', 'C', 'A', 'T', 'T', 'C', 'T', 'G', 'A', 'C', 'T', 'G', 'C', 'A', 'A', 'C', 'G', 'G', 'G', 'C', 'A', 'A', 'T', 'A', 'T', 'G', 'T', 'C', 'T', 'C', 'T', 'G', 'T', 'G', 'T', 'G', 'G', 'A', 'T', 'T', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'G', 'A', 'G', 'T', 'G', 'T', 'C', 'T', 'G', 'A', 'T', 'A', 'G', 'C', 'A', 'G', 'C']\n",
      "20\n",
      "17\n",
      "12\n",
      "21\n"
     ]
    }
   ],
   "source": [
    "# 你的代码\n",
    "DNA = 'A G C T T T T C A T T C T G A C T G C A A C G G G C A A T A T G T C T C T G T G T G G A T T A A A A A A A G A G T G T C T G A T A G C A G C'\n",
    "list = DNA.split()\n",
    "print(list)\n",
    "count_A = list.count('A')\n",
    "count_G = list.count('G')\n",
    "count_C = list.count('C')\n",
    "count_T = list.count('T')\n",
    "print(count_A)\n",
    "print(count_G)\n",
    "print(count_C)\n",
    "print(count_T)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 题目二\n",
    "\n",
    "一个花样滑冰运动员表演后，裁判给表演内容进行评分，分数从0.25分到10分，每次增加值为0.25分。\n",
    "\n",
    "试生成一个元组，把可能的得分存入元组，并遍历元组的每一项，打印“一个运动员可能得_____分”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0, 5.25, 5.5, 5.75, 6.0, 6.25, 6.5, 6.75, 7.0, 7.25, 7.5, 7.75, 8.0, 8.25, 8.5, 8.75, 9.0, 9.25, 9.5, 9.75, 10.0)\n",
      "一个运动员可能得0.25分\n",
      "一个运动员可能得0.5分\n",
      "一个运动员可能得0.75分\n",
      "一个运动员可能得1.0分\n",
      "一个运动员可能得1.25分\n",
      "一个运动员可能得1.5分\n",
      "一个运动员可能得1.75分\n",
      "一个运动员可能得2.0分\n",
      "一个运动员可能得2.25分\n",
      "一个运动员可能得2.5分\n",
      "一个运动员可能得2.75分\n",
      "一个运动员可能得3.0分\n",
      "一个运动员可能得3.25分\n",
      "一个运动员可能得3.5分\n",
      "一个运动员可能得3.75分\n",
      "一个运动员可能得4.0分\n",
      "一个运动员可能得4.25分\n",
      "一个运动员可能得4.5分\n",
      "一个运动员可能得4.75分\n",
      "一个运动员可能得5.0分\n",
      "一个运动员可能得5.25分\n",
      "一个运动员可能得5.5分\n",
      "一个运动员可能得5.75分\n",
      "一个运动员可能得6.0分\n",
      "一个运动员可能得6.25分\n",
      "一个运动员可能得6.5分\n",
      "一个运动员可能得6.75分\n",
      "一个运动员可能得7.0分\n",
      "一个运动员可能得7.25分\n",
      "一个运动员可能得7.5分\n",
      "一个运动员可能得7.75分\n",
      "一个运动员可能得8.0分\n",
      "一个运动员可能得8.25分\n",
      "一个运动员可能得8.5分\n",
      "一个运动员可能得8.75分\n",
      "一个运动员可能得9.0分\n",
      "一个运动员可能得9.25分\n",
      "一个运动员可能得9.5分\n",
      "一个运动员可能得9.75分\n",
      "一个运动员可能得10.0分\n"
     ]
    }
   ],
   "source": [
    "# 你的代码\n",
    "scores = [0.25 + x*(10.25-0.25)/40 for x in range(40)]\n",
    "tuple_scores = tuple(scores)\n",
    "print(tuple_scores)\n",
    "\n",
    "for i in range(len(tuple_scores)):\n",
    "    print(\"一个运动员可能得%s分\" % tuple_scores[i])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 题目三\n",
    "\n",
    "创建一个字典，列出你所了解的地域美食，比如{'肠粉':{'城市':'广州','原料':'米'}}。当然，你可以做的更丰富一些。\n",
    "最后遍历你熟悉的美食，打印出，类似如下的句子：“肠粉是广州的一种美食，它的主要原料是米”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "肠粉是广州的一种美食,它的主要原料是米,常常在早餐见到。\n",
      "烧鹅是香港的一种美食,它的主要原料是鹅,常常在中式正餐见到。\n",
      "蚵仔煎是台湾的一种美食,它的主要原料是壳类海产,常常在小吃见到。\n",
      "辣子鸡是成都的一种美食,它的主要原料是鸡,常常在中式正餐见到。\n"
     ]
    }
   ],
   "source": [
    "# 你的代码\n",
    "dic= {'肠粉':{'城市':'广州','原料':'米','食用场景':'早餐'},\n",
    "      '烧鹅':{'城市':'香港','原料':'鹅','食用场景':'中式正餐'},\n",
    "      '蚵仔煎':{'城市':'台湾','原料':'壳类海产','食用场景':'小吃'},\n",
    "     '辣子鸡':{'城市':'成都','原料':'鸡','食用场景':'中式正餐'}}\n",
    "for dic_name, dic_information in dic.items():\n",
    "    print('%s是%s的一种美食,'% (dic_name.title(),dic_information['城市'])+'它的主要原料是%s,'%dic_information['原料']+'常常在%s见到。'%dic_information['食用场景'])\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
